/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import com.sun.jersey.api.client.Client;
import com.sun.jersey.oauth.client.OAuthClientFilter;
import com.sun.jersey.oauth.signature.OAuthParameters;
import com.sun.jersey.oauth.signature.OAuthSecrets;

/**
 *
 * @author jhon
 */
public class SettingsVisa {

    private static final String CONSUMER_KEY = "2caefc7b6f1e4d12a6c3aab8ab5c633d";
    private static final String CONSUMER_SECRET = "05d03c4a3b8542709f677b59e2a94571";
    private static final String MICROBLOG_URL = "http://localhost:8080/VisaWS/";
    private static final String REQUEST_TOKEN_URL = MICROBLOG_URL + "requestToken";
    private static final String ACCESS_TOKEN_URL = MICROBLOG_URL + "accessToken";
    private static final String AUTHORIZE_URL = MICROBLOG_URL + "authorize";
    public static final String FRIENDS_TIMELINE_URL = MICROBLOG_URL;
    private static final Client cachedClient;
    private static final OAuthParameters parameters;

    static {
        // create a new Jersey client
        cachedClient = Client.create();
        parameters = new OAuthParameters().consumerKey(CONSUMER_KEY).signatureMethod("HMAC-SHA1").version("1.0").nonce();
        // create a new OAuth client filter passing the needed info
        OAuthClientFilter filter = new OAuthClientFilter(
                cachedClient.getProviders(),
                parameters,
                new OAuthSecrets().consumerSecret(CONSUMER_SECRET),
                null,
                null,
                null,
                null);
        // Add filter to the client
        cachedClient.addFilter(filter);
    }

    public static Client getClient() {
        return cachedClient;
    }

    public static void setVerifier(String verifier) {
        parameters.verifier(verifier);
    }
}